﻿//Write a program that calculates N!*K! / (K-N)! for given N and K (1<N<K).

using System;
using System.Numerics;

class FormulaWithFactorial
{
    static void Main()
    {
        Console.Write("Enter N = ");
        BigInteger n = BigInteger.Parse(Console.ReadLine());
        Console.Write("Enter K = ");
        BigInteger k = BigInteger.Parse(Console.ReadLine());

        if (n > 1 && k > n)
        {
            BigInteger result = 1;
            for (BigInteger i = 1; i <= n; i++)
            {
                result = result * i * (i + (k - n));
            }
            Console.WriteLine("{0}!*{1}! / ({1}-{0})! = {2}", n, k, result);
        }
        else
        {
            Console.WriteLine("Out of range (1 < N < K) !");
        }
    }
}
